# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-opytimizer
_pkgorig=opytimizer
pkgver=3.1.4
pkgrel=0
pkgdesc="A Python library consisting of nature-inspired meta-heuristic optimization algorithms"
url="https://github.com/gugarosa/opytimizer"
arch="noarch !riscv64"
license="Apache-2.0"
depends="
	python3
	py3-dill
	py3-matplotlib
	py3-networkx
	py3-numpy
	py3-opytimark
	py3-tqdm
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist xvfb-run"
subpackages="$pkgname-pyc"
source="https://github.com/gugarosa/opytimizer/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	xvfb-run -a python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -k 'not plot and not test_opytimizer_load and not test_cdo'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
51d57ba50a1ebdc2e8d3bb9762e22fa47e0a956a5f115673a58502f63a3add94c0056d571af4864d782a2ff0d965322614eb5b46dc7bb56306eb87719352db5d  opytimizer-3.1.4.tar.gz
"
